package com.blog.boot.api.entity;

import com.blog.boot.api.annotation.AutoIncKey;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

/**
 * @author : cailong
 * @since : Created in 下午 4:23 2018/12/14 0014
 */
@Data
@NoArgsConstructor
@Document(collection="user")
public class UserEntity {
    @Id
    @AutoIncKey
    private Long id = 0L;
    @Field
    private String username,sign,email,avatar,sex,city,ip,jointime,web_qq,start,password,authentication;

    private Long role;

    public UserEntity( String ip, String jointime) {
        this.sign = "这个人很懒,连签名都来不及写";
        this.avatar = "/index/images/avatar/00.jpg";
        this.sex = "0";
        this.city = "中国";
        this.ip = ip;
        this.jointime = jointime;
        this.web_qq = "";
        this.start = "0";
        this.role = Long.valueOf("3");
        this.authentication = "";
    }
}
